export const form_mixin = {
  data() {
    return {
      form: {
        visible: false,//表单显示标识
        title: "",//表单显示的标题
        editable: false,//表单编辑状态标识
        entry: {},//表单绑定的实体对象
      }
    }
  },
  methods: {
    /**表单重置*/
    formReset() {
      this.formMode(false, "", false, {})
    },
    /**表单模式*/
    formMode(visible = false, title = "", edit = false, entry) {
      this.form.visible = visible
      this.form.title = title
      this.form.editable = edit
      if (entry) {
        this.form.entry = this.$utils.lodash.cloneDeep(entry)
      }
    },
  }
}